package com.voe.common;

public enum TraceLevel {
	
	/** no trace
	 */
	kTraceNone(0x0000), 
	kTraceStateInfo(0x0001),
	kTraceWarning(0x0002),
	kTraceError(0x0004),
	kTraceCritical(0x0008),
	kTraceApiCall(0x0010),
	kTraceDefault(0x00ff),

	kTraceModuleCall(0x0020),
	/** memory info
	 */
	kTraceMemory(0x0100),
	/** timing info
	 */
	kTraceTimer(0x0200),
	/** "continuous" stream of data
	 */
	kTraceStream(0x0400),

	// used for debug purposes
	/** debug
	 */
	kTraceDebug(0x0800), // debug
	/** debug info
	 */
	kTraceInfo(0x1000), // debug info

	/** Non-verbose level used by LS_INFO of logging.h. Do not use directly.
	 */
	kTraceTerseInfo(0x2000),

	kTraceAll(0xffff);

	public static TraceLevel fromValue(int value) {
		for (int i=0;i<TraceLevel.values().length;i++) {
			if(TraceLevel.values()[i].getValue() == value)
				return TraceLevel.values()[i];
		}
		return null;
	}

	/**
	 * Constructor.
	 */
	private TraceLevel(int value) {
		this.value = value;
	}

	/**
	 * Get the value.
	 * 
	 * @return the value
	 */
	public int getValue() {
		return value;
	}

	private final int value;
}
